home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 June: Reference Library / Dev.CD Jun 95 / Dev.CD Jun 95.toast / What's New? / Sample Code / MoreFiles 1.3 / MoreFilesExtras.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-18  |  55.3 KB  |  1,581 lines  |  [TEXT/MMCC]

  1. /*
  2. **    Apple Macintosh Developer Technical Support
  3. **
  4. **    A collection of useful high-level File Manager routines.
  5. **
  6. **    by Jim Luther, Apple Developer Technical Support
  7. **
  8. **    File:        MoreFilesExtras.h
  9. **
  10. **    Copyright © 1992-1995 Apple Computer, Inc.
  11. **    All rights reserved.
  12. **
  13. **    You may incorporate this sample code into your applications without
  14. **    restriction, though the sample code has been provided "AS IS" and the
  15. **    responsibility for its operation is 100% yours.  However, what you are
  16. **    not permitted to do is to redistribute the source as "DSC Sample Code"
  17. **    after having made changes. If you're going to re-distribute the source,
  18. **    we require that you make it clear in the source that the code was
  19. **    descended from Apple Sample Code, but that you've made changes.
  20. */
  21.  
  22. #ifndef __MOREFILESEXTRAS__
  23. #define __MOREFILESEXTRAS__
  24.  
  25. #include <Types.h>
  26. #include <Files.h>
  27.  
  28. /*****************************************************************************/
  29.  
  30. /*
  31. **    Macros to get information out of GetVolParmsInfoBuffer
  32. */
  33.  
  34. #define    isNetworkVolume(volParms)    ((volParms).vMServerAdr != 0)
  35. #define    hasLimitFCBs(volParms)        (((volParms).vMAttrib & (1L << bLimitFCBs)) != 0)
  36. #define    hasLocalWList(volParms)        (((volParms).vMAttrib & (1L << bLocalWList)) != 0)
  37. #define    hasNoMiniFndr(volParms)        (((volParms).vMAttrib & (1L << bNoMiniFndr)) != 0)
  38. #define hasNoVNEdit(volParms)        (((volParms).vMAttrib & (1L << bNoVNEdit)) != 0)
  39. #define hasNoLclSync(volParms)        (((volParms).vMAttrib & (1L << bNoLclSync)) != 0)
  40. #define hasTrshOffLine(volParms)    (((volParms).vMAttrib & (1L << bTrshOffLine)) != 0)
  41. #define hasNoSwitchTo(volParms)        (((volParms).vMAttrib & (1L << bNoSwitchTo)) != 0)
  42. #define hasNoDeskItems(volParms)    (((volParms).vMAttrib & (1L << bNoDeskItems)) != 0)
  43. #define hasNoBootBlks(volParms)        (((volParms).vMAttrib & (1L << bNoBootBlks)) != 0)
  44. #define hasAccessCntl(volParms)        (((volParms).vMAttrib & (1L << bAccessCntl)) != 0)
  45. #define hasNoSysDir(volParms)        (((volParms).vMAttrib & (1L << bNoSysDir)) != 0)
  46. #define hasExtFSVol(volParms)        (((volParms).vMAttrib & (1L << bHasExtFSVol)) != 0)
  47. #define hasOpenDeny(volParms)        (((volParms).vMAttrib & (1L << bHasOpenDeny)) != 0)
  48. #define hasCopyFile(volParms)        (((volParms).vMAttrib & (1L << bHasCopyFile)) != 0)
  49. #define hasMoveRename(volParms)        (((volParms).vMAttrib & (1L << bHasMoveRename)) != 0)
  50. #define hasDesktopMgr(volParms)        (((volParms).vMAttrib & (1L << bHasDesktopMgr)) != 0)
  51. #define hasShortName(volParms)        (((volParms).vMAttrib & (1L << bHasShortName)) != 0)
  52. #define hasFolderLock(volParms)        (((volParms).vMAttrib & (1L << bHasFolderLock)) != 0)
  53. #define hasPersonalAccessPrivileges(volParms) \
  54.         (((volParms).vMAttrib & (1L << bHasPersonalAccessPrivileges)) != 0)
  55. #define hasUserGroupList(volParms)    (((volParms).vMAttrib & (1L << bHasUserGroupList)) != 0)
  56. #define hasCatSearch(volParms)        (((volParms).vMAttrib & (1L << bHasCatSearch)) != 0)
  57. #define hasFileIDs(volParms)        (((volParms).vMAttrib & (1L << bHasFileIDs)) != 0)
  58. #define hasBTreeMgr(volParms)        (((volParms).vMAttrib & (1L << bHasBTreeMgr)) != 0)
  59. #define hasBlankAccessPrivileges(volParms) \
  60.         (((volParms).vMAttrib & (1L << bHasBlankAccessPrivileges)) != 0)
  61.  
  62. /*****************************************************************************/
  63.  
  64. /*
  65. **    Deny mode permissions for use with the HOpenAware, HOpenRFAware,
  66. **    FSpOpenAware, and FSpOpenRFAware functions.
  67. */
  68.  
  69. enum
  70. {
  71.     dmNone            = 0x0000,
  72.     dmNoneDenyRd    = 0x0010,
  73.     dmNoneDenyWr    = 0x0020,
  74.     dmNoneDenyRdWr    = 0x0030,
  75.     dmRd            = 0x0001,    /* Single writer, multiple readers; the readers */
  76.     dmRdDenyRd        = 0x0011,
  77.     dmRdDenyWr        = 0x0021,    /* Browsing - equivalent to fsRdPerm */
  78.     dmRdDenyRdWr    = 0x0031,
  79.     dmWr            = 0x0002,
  80.     dmWrDenyRd        = 0x0012,
  81.     dmWrDenyWr        = 0x0022,
  82.     dmWrDenyRdWr    = 0x0032,
  83.     dmRdWr            = 0x0003,    /* Shared access - equivalent to fsRdWrShPerm */
  84.     dmRdWrDenyRd    = 0x0013,
  85.     dmRdWrDenyWr    = 0x0023,    /* Single writer, multiple readers; the writer */
  86.     dmRdWrDenyRdWr    = 0x0033    /* Exclusive access - equivalent to fsRdWrPerm */
  87. };
  88.     
  89. /*****************************************************************************/
  90.  
  91. /*
  92. **    For those times where you need to use more than one kind of File Manager parameter
  93. **    block but don't feel like wasting stack space, here's a parameter block you can reuse.
  94. */
  95.  
  96. #if GENERATINGPOWERPC
  97. #pragma options align=mac68k
  98. #endif
  99. union UniversalFMPB
  100. {
  101.     ParamBlockRec    PB;
  102.     CInfoPBRec        ciPB;
  103.     DTPBRec            dtPB;
  104.     HParamBlockRec    hPB;
  105.     CMovePBRec        cmPB;
  106.     WDPBRec            wdPB;
  107.     FCBPBRec        fcbPB;
  108. };
  109. #if GENERATINGPOWERPC
  110. #pragma options align=reset
  111. #endif
  112.  
  113. typedef union UniversalFMPB UniversalFMPB;
  114. typedef UniversalFMPB *UniversalFMPBPtr, **UniversalFMPBHandle;
  115.  
  116.  
  117. /*
  118. **    Used by GetUGEntries to return user or group lists
  119. */
  120.  
  121. #if GENERATINGPOWERPC
  122. #pragma options align=mac68k
  123. #endif
  124. struct UGEntry
  125. {
  126.     short    objType;    /* object type: -1 = group; 0 = user */
  127.     long    objID;        /* the user or group ID */
  128.     Str31    name;        /* the user or group name */
  129. };
  130. #if GENERATINGPOWERPC
  131. #pragma options align=reset
  132. #endif
  133.  
  134. typedef struct UGEntry UGEntry;
  135. typedef UGEntry *UGEntryPtr, **UGEntryHandle;
  136.  
  137.  
  138. typedef unsigned char Str8[9];
  139.  
  140.  
  141. /*
  142. **    I use the following record instead of the AFPVolMountInfo structure in Files.h
  143. */
  144.  
  145. #if GENERATINGPOWERPC
  146. #pragma options align=mac68k
  147. #endif
  148. struct MyAFPVolMountInfo
  149. {
  150.     short length;                /* length of this record */
  151.     VolumeType media;            /* type of media, always AppleShareMediaType */
  152.     short flags;                /* 0 = normal mount; set bit 0 to inhibit greeting messages */
  153.     char nbpInterval;            /* NBP interval parameter; 7 is a good choice */
  154.     char nbpCount;                /* NBP count parameter; 5 is a good choice */
  155.     short uamType;                /* User Authentication Method */
  156.     short zoneNameOffset;        /* offset from start of record to zoneName */
  157.     short serverNameOffset;        /* offset from start of record to serverName */
  158.     short volNameOffset;        /* offset from start of record to volName */
  159.     short userNameOffset;        /* offset from start of record to userName */
  160.     short userPasswordOffset;    /* offset from start of record to userPassword */
  161.     short volPasswordOffset;    /* offset from start of record to volPassword */
  162.     Str31 zoneName;                /* server's AppleTalk zone name */                    
  163.     Str31 serverName;            /* server name */                    
  164.     Str27 volName;                /* volume name */                    
  165.     Str31 userName;                /* user name (zero length Pascal string for guest) */
  166.     Str8 userPassword;            /* user password (zero length Pascal string if no user password) */                    
  167.     char filler1;                /* to word align volPassword */
  168.     Str8 volPassword;            /* volume password (zero length Pascal string if no volume password) */                    
  169.     char filler2;                /* to end record on word boundry */
  170. };
  171. #if GENERATINGPOWERPC
  172. #pragma options align=reset
  173. #endif
  174.  
  175. typedef struct MyAFPVolMountInfo MyAFPVolMountInfo;
  176. typedef MyAFPVolMountInfo *MyAFPVolMountInfoPtr, **MyAFPVolMountInfoHandle;
  177.  
  178. /*****************************************************************************/
  179.  
  180. pascal    Ptr    GetTempBuffer(long buffReqSize,
  181.                           long *buffActSize);
  182. /*    ¶ Allocate a temporary copy or search buffer.
  183.     The GetTempBuffer function allocates a temporary buffer for file system
  184.     operations which is at least 1024 bytes (1K) and a multiple of
  185.     1024 bytes.
  186.     
  187.     buffReqSize        input:    Size you'd like the buffer to be.
  188.     buffActSize        output:    Size of buffer allocated.
  189.     function result    output:    Pointer to memory allocated or nil if no memory
  190.                             was available. The caller is responsible for
  191.                             disposing of this buffer with DisposePtr.
  192. */
  193.  
  194. /*****************************************************************************/
  195.  
  196. pascal    OSErr    DetermineVRefNum(StringPtr pathname,
  197.                                  short vRefNum,
  198.                                  short *realVRefNum);
  199. /*    ¶ Determine the real volume reference number.
  200.     The DetermineVRefNum function determines the volume reference number of
  201.     a volume from a pathname, a volume specification, or a combination
  202.     of the two.
  203.     WARNING: Volume names on the Macintosh are *not* unique -- Multiple
  204.     mounted volumes can have the same name. For this reason, the use of a
  205.     volume name or full pathname to identify a specific volume may not
  206.     produce the results you expect.  If more than one volume has the same
  207.     name and a volume name or full pathname is used, the File Manager
  208.     currently uses the first volume it finds with a matching name in the
  209.     volume queue.
  210.  
  211.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  212.                         partial pathname, it is ignored. A full pathname to a
  213.                         volume must end with a colon character (:).
  214.     vRefNum        input:    Volume specification (volume reference number, working
  215.                         directory number, drive number, or 0).
  216.     realVRefNum    output:    The real volume reference number.
  217. */
  218.  
  219. /*****************************************************************************/
  220.  
  221. pascal    OSErr    HGetVInfo(short volReference,
  222.                           StringPtr volName,
  223.                           short *vRefNum,
  224.                           unsigned long *freeBytes,
  225.                           unsigned long *totalBytes);
  226. /*    ¶ Get information about a mounted volume.
  227.     The HGetVInfo function returns the name, volume reference number,
  228.     available space (in bytes), and total space (in bytes) for the
  229.     specified volume. You can specify the volume by providing its drive
  230.     number, volume reference number, or 0 for the default volume.
  231.     This routine is compatible with volumes up to 4 gigabytes.
  232.     
  233.     volReference    input:    The drive number, volume reference number,
  234.                             or 0 for the default volume.
  235.     volName            input:    A pointer to a buffer (minimum Str27) where
  236.                             the volume name is to be returned or must
  237.                             be nil.
  238.                     output:    The volume name.
  239.     vRefNum            output:    The volume reference number.
  240.     freeBytes        output:    The number of free bytes on the volume.
  241.                             freeBytes is an unsigned long value.
  242.     totalBytes        output:    The total number of bytes on the volume.
  243.                             totalBytes is an unsigned long value.
  244. */
  245.  
  246. /*****************************************************************************/
  247.  
  248. pascal    OSErr    CheckVolLock(StringPtr pathname,
  249.                              short vRefNum);
  250. /*    ¶ Determine if a volume is locked.
  251.     The CheckVolLock function determines if a volume is locked - either by
  252.     hardware or by software. If CheckVolLock returns noErr, then the volume
  253.     is not locked.
  254.  
  255.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  256.                         partial pathname, it is ignored. A full pathname to a
  257.                         volume must end with a colon character (:).
  258.     vRefNum        input:    Volume specification (volume reference number, working
  259.                         directory number, drive number, or 0).
  260. */
  261.  
  262. /*****************************************************************************/
  263.  
  264. pascal    OSErr GetDriverName(short driverRefNum,
  265.                             Str255 driverName);
  266. /*    ¶ Get a device driver's name.
  267.     The GetDriverName function returns a device driver's name.
  268.  
  269.     driverRefNum    input:    The driver reference number.
  270.     driverName        output:    The driver's name.
  271. */
  272.  
  273. /*****************************************************************************/
  274.  
  275. pascal    OSErr    FindDrive(StringPtr pathname,
  276.                           short vRefNum,
  277.                           DrvQElPtr *driveQElementPtr);
  278. /*    ¶ Find a volume's drive queue element in the drive queue.
  279.     The FindDrive function returns a pointer to a mounted volume's
  280.     drive queue element.
  281.  
  282.     pathName            input:    Pointer to a full pathname or nil. If you
  283.                                 pass in a partial pathname, it is ignored.
  284.                                 A full pathname to a volume must end with
  285.                                 a colon character (:).
  286.     vRefNum                input:    Volume specification (volume reference
  287.                                 number, working directory number, drive
  288.                                 number, or 0).
  289.     driveQElementPtr    output:    Pointer to a volume's drive queue element
  290.                                 in the drive queue. DO NOT change the
  291.                                 DrvQEl.
  292. */
  293.  
  294. /*****************************************************************************/
  295.  
  296. pascal    OSErr    UnmountAndEject(StringPtr pathname,
  297.                                 short vRefNum);
  298. /*    ¶ Unmount and eject a volume.
  299.     The UnmountAndEject function unmounts and ejects a volume. The volume
  300.     is ejected only if it is ejectable and not already ejected.
  301.     
  302.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  303.                         partial pathname, it is ignored. A full pathname to a
  304.                         volume must end with a colon character (:).
  305.     vRefNum        input:    Volume specification (volume reference number, working
  306.                         directory number, drive number, or 0).
  307. */
  308.  
  309. /*****************************************************************************/
  310.  
  311. pascal    OSErr    OnLine(FSSpecPtr volumes,
  312.                        short reqVolCount,
  313.                        short *actVolCount,
  314.                        short *volIndex);
  315. /*    ¶ Return the list of volumes currently mounted.
  316.     The OnLine function returns the list of volumes currently mounted in
  317.     an array of FSSpec records.
  318.  
  319.     volumes        input:    Pointer to array of FSSpec where the volume list
  320.                         is returned.
  321.     reqVolCount    input:    Maximum number of volumes to return    (the number of
  322.                         elements in the volumes array).
  323.     actVolCount    output: The number of volumes actually returned.
  324.     volIndex    input:    The current volume index position. Set to 1 to
  325.                         start with the first volume.
  326.                 output:    The volume index position to get the next volume.
  327.                         Pass this value the next time you call OnLine to
  328.                         start where you left off.
  329. */
  330.  
  331. /*****************************************************************************/
  332.  
  333. pascal    OSErr GetDInfo(short vRefNum,
  334.                        long dirID,
  335.                        StringPtr name,
  336.                        DInfo *fndrInfo);
  337. /*    ¶ Get the finder information for a directory.
  338.     The GetDInfo function gets the finder information for a directory.
  339.  
  340.     vRefNum            input:    Volume specification.
  341.     dirID            input:    Directory ID.
  342.     name            input:    Pointer to object name, or nil when dirID
  343.                             specifies a directory that's the object.
  344.     fndrInfo        output:    If the object is a directory, then its DInfo.
  345.  
  346.     __________
  347.     
  348.     Also see:    FSpGetDInfo,
  349. */
  350.  
  351. /*****************************************************************************/
  352.  
  353. pascal    OSErr FSpGetDInfo(const FSSpec *spec,
  354.                           DInfo *fndrInfo);
  355. /*    ¶ Get the finder information for a directory.
  356.     The FSpGetDInfo function gets the finder information for a directory.
  357.  
  358.     spec        input:    An FSSpec record specifying the directory.
  359.     fndrInfo    output:    If the object is a directory, then its DInfo.
  360.  
  361.     __________
  362.     
  363.     Also see:    FSpGetFInfoCompat, GetDInfo
  364. */
  365.  
  366. /*****************************************************************************/
  367.  
  368. pascal    OSErr SetDInfo(short vRefNum,
  369.                        long dirID,
  370.                        StringPtr name,
  371.                        const DInfo *fndrInfo);
  372. /*    ¶ Set the finder information for a directory.
  373.     The SetDInfo function sets the finder information for a directory.
  374.  
  375.     vRefNum            input:    Volume specification.
  376.     dirID            input:    Directory ID.
  377.     name            input:    Pointer to object name, or nil when dirID
  378.                             specifies a directory that's the object.
  379.     fndrInfo        input:    The DInfo.
  380.  
  381.     __________
  382.     
  383.     Also see:    FSpSetDInfo,
  384. */
  385.  
  386. /*****************************************************************************/
  387.  
  388. pascal    OSErr FSpSetDInfo(const FSSpec *spec,
  389.                           const DInfo *fndrInfo);
  390. /*    ¶ Set the finder information for a directory.
  391.     The FSpSetDInfo function sets the finder information for a directory.
  392.  
  393.     spec        input:    An FSSpec record specifying the directory.
  394.     fndrInfo    input:    The DInfo.
  395.  
  396.     __________
  397.     
  398.     Also see:    FSpSetFInfoCompat, SetDInfo
  399. */
  400.  
  401. /*****************************************************************************/
  402.  
  403. pascal    OSErr    GetDirID(short vRefNum,
  404.                          long dirID,
  405.                          StringPtr name,
  406.                          long *theDirID,
  407.                          Boolean *isDirectory);
  408. /*    ¶ Get the directory ID number of the directory specified.
  409.     The GetDirID function gets the directory ID number of the directory
  410.     specified.  If a file is specified, then the parent
  411.     directory of the file is returned and isDirectory is false.  If
  412.     a directory is specified, then that directory's ID number is
  413.     returned and isDirectory is true.
  414.     WARNING: Volume names on the Macintosh are *not* unique -- Multiple
  415.     mounted volumes can have the same name. For this reason, the use of a
  416.     volume name or full pathname to identify a specific volume may not
  417.     produce the results you expect.  If more than one volume has the same
  418.     name and a volume name or full pathname is used, the File Manager
  419.     currently uses the first volume it finds with a matching name in the
  420.     volume queue.
  421.     
  422.     vRefNum            input:    Volume specification.
  423.     dirID            input:    Directory ID.
  424.     name            input:    Pointer to object name, or nil when dirID
  425.                             specifies a directory that's the object.
  426.     theDirID        output:    If the object is a file, then its parent directory
  427.                             ID. If the object is a directory, then its ID.
  428.     isDirectory        output:    True if object is a directory; false if
  429.                             object is a file.
  430. */
  431.  
  432. /*****************************************************************************/
  433.  
  434. pascal    OSErr    DirIDFromFSSpec(const FSSpec *spec,
  435.                                 long *dirID,
  436.                                 Boolean *isDirectory);
  437. /*    ¶ Get the directory ID number of a directory.
  438.     The DirIDFromFSSpec function gets the directory ID number of the
  439.     directory specified by spec. If spec is to a file, then the parent
  440.     directory of the file is returned and isDirectory is false.  If
  441.     spec is to a directory, then that directory's ID number is
  442.     returned and isDirectory is true.
  443.     
  444.     spec            input:    An FSSpec record specifying the directory.
  445.     theDirID        output:    The directory ID.
  446.     isDirectory        output:    True if object is a directory; false if
  447.                             object is a file.
  448. */
  449.  
  450. /*****************************************************************************/
  451.  
  452. pascal    OSErr    GetDirName(short vRefNum,
  453.                            long dirID,
  454.                            StringPtr name);
  455. /*    ¶ Get the name of a directory from its directory ID.
  456.     The GetDirName function gets the name of a directory from its
  457.     directory ID.
  458.  
  459.     vRefNum        input:    Volume specification.
  460.     dirID        input:    Directory ID.
  461.     name        output:    Points to a buffer (minimum Str63) where the
  462.                         directory name is to be returned or must be nil.
  463. */
  464.  
  465. /*****************************************************************************/
  466.  
  467. pascal    OSErr    GetParentID(short vRefNum,
  468.                             long dirID,
  469.                             StringPtr name,
  470.                             long *parID);
  471. /*    ¶ Get the parent directory ID number of the specified object.
  472.     The GetParentID function gets the parent directory ID number of the
  473.     specified object.
  474.     
  475.     vRefNum        input:    Volume specification.
  476.     dirID        input:    Directory ID.
  477.     name        input:    Pointer to object name, or nil when dirID specifies
  478.                         a directory that's the object.
  479.     parID        output:    The parent directory ID of the specified object.
  480. */
  481.  
  482. /*****************************************************************************/
  483.  
  484. pascal    OSErr    GetFilenameFromPathname(ConstStr255Param pathname,
  485.                                         Str255 filename);
  486. /*    ¶ Get the object name from the end of a full or partial pathname.
  487.     The GetFilenameFromPathname function gets the file (or directory) name
  488.     from the end of a full or partial pathname. Returns notAFileErr if the
  489.     pathname is nil, the pathname is empty, or the pathname cannot refer to
  490.     a filename (with a noErr result, the pathname could still refer to a
  491.     directory).
  492.     
  493.     pathname    input:    A full or partial pathname.
  494.     filename    output:    The file (or directory) name.
  495.  
  496.     __________
  497.     
  498.     See also:    GetObjectLocation.
  499. */
  500.  
  501. /*****************************************************************************/
  502.  
  503. pascal    OSErr    GetObjectLocation(short vRefNum,
  504.                                   long dirID,
  505.                                   StringPtr pathname,
  506.                                   short *realVRefNum,
  507.                                   long *realParID,
  508.                                   Str255 realName,
  509.                                   Boolean *isDirectory);
  510. /*    ¶ Get a file system object's location.
  511.     The GetObjectLocation function gets a file system object's location -
  512.     that is, its real volume reference number, real parent directory ID,
  513.     and name. While we're at it, determine if the object is a file or directory.
  514.     If GetObjectLocation returns fnfErr, then the location information
  515.     returned is valid, but it describes an object that doesn't exist.
  516.     You can use the location information for another operation, such as
  517.     creating a file or directory.
  518.     
  519.     vRefNum        input:    Volume specification.
  520.     dirID        input:    Directory ID.
  521.     pathname    input:    Pointer to object name, or nil when dirID specifies
  522.                         a directory that's the object.
  523.     realVRefNum    output:    The real volume reference number.
  524.     realParID    output:    The parent directory ID of the specified object.
  525.     realName    output:    The name of the specified object (the case of the
  526.                         object name may not be the same as the object's
  527.                         catalog entry on disk - since the Macintosh file
  528.                         system is not case sensitive, it shouldn't matter).
  529.     isDirectory    output:    True if object is a directory; false if object
  530.                         is a file.
  531.  
  532.     __________
  533.     
  534.     See also:    FSMakeFSSpecCompat
  535. */
  536.  
  537. /*****************************************************************************/
  538.  
  539. pascal    OSErr    GetDirItems(short vRefNum,
  540.                             long dirID,
  541.                             StringPtr name,
  542.                             Boolean getFiles,
  543.                             Boolean getDirectories,
  544.                             FSSpecPtr items,
  545.                             short reqItemCount,
  546.                             short *actItemCount,
  547.                             short *itemIndex);
  548. /*    ¶ Return a list of items in a directory.
  549.     The GetDirItems function returns a list of items in the specified
  550.     directory in an array of FSSpec records. File, subdirectories, or
  551.     both can be returned in the list.
  552.  
  553.     vRefNum            input:    Volume specification.
  554.     dirID            input:    Directory ID.
  555.     name            input:    Pointer to object name, or nil when dirID
  556.                             specifies a directory that's the object.
  557.     getFiles        input:    Pass true to have files added to the items list.
  558.     getDirectories    input:    Pass true to have directories added to the
  559.                             items list.
  560.     items            input:    Pointer to array of FSSpec where the item list
  561.                             is returned.
  562.     reqItemCount    input:    Maximum number of items to return (the number
  563.                             of elements in the items array).
  564.     actItemCount    output: The number of items actually returned.
  565.     itemIndex        input:    The current item index position. Set to 1 to
  566.                             start with the first item in the directory.
  567.                     output:    The item index position to get the next item.
  568.                             Pass this value the next time you call
  569.                             GetDirItems to start where you left off.
  570. */
  571.  
  572. /*****************************************************************************/
  573.  
  574. pascal    OSErr    DeleteDirectoryContents(short vRefNum,
  575.                                          long dirID,
  576.                                         StringPtr name);
  577. /*    ¶ Delete the contents of a directory.
  578.     The DeleteDirectoryContents function deletes the contents of a directory.
  579.     All files and subdirectories in the specified directory are deleted.
  580.     If a locked file or directory is encountered, it is unlocked and then
  581.     deleted.  If any unexpected errors are encountered,
  582.     DeleteDirectoryContents quits and returns to the caller.
  583.     
  584.     vRefNum    input:    Volume specification.
  585.     dirID    input:    Directory ID.
  586.     name    input:    Pointer to directory name, or nil when dirID specifies
  587.                     a directory that's the object.
  588.  
  589.     __________
  590.     
  591.     Also see:    DeleteDirectory
  592. */
  593.  
  594. /*****************************************************************************/
  595.  
  596. pascal    OSErr    DeleteDirectory(short vRefNum,
  597.                                 long dirID,
  598.                                 StringPtr name);
  599. /*    ¶ Delete a directory and its contents.
  600.     The DeleteDirectory function deletes a directory and its contents.
  601.     All files and subdirectories in the specified directory are deleted.
  602.     If a locked file or directory is encountered, it is unlocked and then
  603.     deleted.  After deleting the directories contents, the directory is
  604.     deleted. If any unexpected errors are encountered, DeleteDirectory
  605.     quits and returns to the caller.
  606.     
  607.     vRefNum    input:    Volume specification.
  608.     dirID    input:    Directory ID.
  609.     name    input:    Pointer to directory name, or nil when dirID specifies
  610.                     a directory that's the object.
  611.  
  612.     __________
  613.     
  614.     Also see:    DeleteDirectoryContents
  615. */
  616.  
  617. /*****************************************************************************/
  618.  
  619. pascal    OSErr    CheckObjectLock(short vRefNum,
  620.                                 long dirID,
  621.                                 StringPtr name);
  622. /*    ¶ Determine if a file or directory is locked.
  623.     The CheckObjectLock function determines if a file or directory is locked.
  624.     If CheckObjectLock returns noErr, then the file or directory
  625.     is not locked.
  626.     
  627.     vRefNum    input:    Volume specification.
  628.     dirID    input:    Directory ID.
  629.     name    input:    Pointer to object name, or nil when dirID specifies
  630.                     a directory that's the object.
  631.  
  632.     __________
  633.     
  634.     Also see:    FSpCheckObjectLock
  635. */
  636.  
  637. /*****************************************************************************/
  638.  
  639. pascal    OSErr    FSpCheckObjectLock(const FSSpec *spec);
  640. /*    ¶ Determine if a file or directory is locked.
  641.     The FSpCheckObjectLock function determines if a file or directory is locked.
  642.     If FSpCheckObjectLock returns noErr, then the file or directory
  643.     is not locked.
  644.     
  645.     spec    input:    An FSSpec record specifying the object.
  646.  
  647.     __________
  648.     
  649.     Also see:    CheckObjectLock
  650. */
  651.  
  652. /*****************************************************************************/
  653.  
  654. pascal    OSErr    GetFileSize(short vRefNum,
  655.                             long dirID,
  656.                             ConstStr255Param fileName,
  657.                             long *dataSize,
  658.                             long *rsrcSize);
  659. /*    ¶ Get the logical sizes of a file's forks.
  660.     The GetFileSize function returns the logical size of a file's
  661.     data and resource fork.
  662.     
  663.     vRefNum        input:    Volume specification.
  664.     dirID        input:    Directory ID.
  665.     name        input:    The name of the file.
  666.     dataSize    output:    The number of bytes in the file's data fork.
  667.     rsrcSize    output:    The number of bytes in the file's resource fork.
  668.  
  669.     __________
  670.     
  671.     See also:    FSpGetFileSize
  672. */
  673.  
  674. /*****************************************************************************/
  675.  
  676. pascal    OSErr    FSpGetFileSize(const FSSpec *spec,
  677.                                long *dataSize,
  678.                                long *rsrcSize);
  679. /*    ¶ Get the logical sizes of a file's forks.
  680.     The FSpGetFileSize function returns the logical size of a file's
  681.     data and resource fork.
  682.     
  683.     spec        input:    An FSSpec record specifying the file.
  684.     dataSize    output:    The number of bytes in the file's data fork.
  685.     rsrcSize    output:    The number of bytes in the file's resource fork.
  686.  
  687.     __________
  688.     
  689.     See also:    GetFileSize
  690. */
  691.  
  692. /*****************************************************************************/
  693.  
  694. pascal    OSErr    BumpDate(short vRefNum,
  695.                          long dirID,
  696.                          StringPtr name);
  697. /*    ¶ Update the modification date of a file or directory.
  698.     The BumpDate function changes the modification date of a file or
  699.     directory to the current date/time.  If the modification date is already
  700.     equal to the current date/time, then add one second to the
  701.     modification date.
  702.     
  703.     vRefNum    input:    Volume specification.
  704.     dirID    input:    Directory ID.
  705.     name    input:    Pointer to object name, or nil when dirID specifies
  706.                     a directory that's the object.
  707.  
  708.     __________
  709.     
  710.     See also:    FSpBumpDate
  711. */
  712.  
  713. /*****************************************************************************/
  714.  
  715. pascal    OSErr    FSpBumpDate(const FSSpec *spec);
  716. /*    ¶ Update the modification date of a file or directory.
  717.     The FSpBumpDate function changes the modification date of a file or
  718.     directory to the current date/time.  If the modification date is already
  719.     equal to the current date/time, then add one second to the
  720.     modification date.
  721.     
  722.     spec    input:    An FSSpec record specifying the object.
  723.  
  724.     __________
  725.     
  726.     See also:    BumpDate
  727. */
  728.  
  729. /*****************************************************************************/
  730.  
  731. pascal    OSErr    ChangeCreatorType(short vRefNum,
  732.                                   long dirID,
  733.                                   ConstStr255Param name,
  734.                                   OSType creator,
  735.                                   OSType fileType);
  736. /*    ¶ Change the creator or file type of a file.
  737.     The ChangeCreatorType function changes the creator or file type of a file.
  738.  
  739.     vRefNum        input:    Volume specification.
  740.     dirID        input:    Directory ID.
  741.     name        input:    The name of the file.
  742.     creator        input:    The new creator type or 0x00000000 to leave
  743.                         the creator type alone.
  744.     fileType    input:    The new file type or 0x00000000 to leave the
  745.                         file type alone.
  746.  
  747.     __________
  748.     
  749.     See also:    FSpChangeCreatorType
  750. */
  751.  
  752. /*****************************************************************************/
  753.  
  754. pascal    OSErr    FSpChangeCreatorType(const FSSpec *spec,
  755.                                      OSType creator,
  756.                                      OSType fileType);
  757. /*    ¶ Change the creator or file type of a file.
  758.     The FSpChangeCreatorType function changes the creator or file type of a file.
  759.  
  760.     spec        input:    An FSSpec record specifying the file.
  761.     creator        input:    The new creator type or 0x00000000 to leave
  762.                         the creator type alone.
  763.     fileType    input:    The new file type or 0x00000000 to leave the
  764.                         file type alone.
  765.  
  766.     __________
  767.     
  768.     See also:    ChangeCreatorType
  769. */
  770.  
  771. /*****************************************************************************/
  772.  
  773. pascal    OSErr    ChangeFDFlags(short vRefNum,
  774.                               long dirID,
  775.                               StringPtr name,
  776.                               Boolean    setBits,
  777.                               unsigned short flagBits);
  778. /*    ¶ Set or clear Finder Flag bits.
  779.     The ChangeFDFlags function sets or clears Finder Flag bits in the
  780.     fdFlags field of a file or directory's FInfo record.
  781.     
  782.     vRefNum        input:    Volume specification.
  783.     dirID        input:    Directory ID.
  784.     name        input:    Pointer to object name, or nil when dirID specifies
  785.                         a directory that's the object.
  786.     setBits        input:    If true, then set the bits specified in flagBits.
  787.                         If false, then clear the bits specified in flagBits.
  788.     flagBits    input:    The flagBits parameter specifies which Finder Flag
  789.                         bits to set or clear. If a bit in flagBits is set,
  790.                         then the same bit in fdFlags is either set or
  791.                         cleared depending on the state of the setBits
  792.                         parameter.
  793.  
  794.     __________
  795.     
  796.     See also:    FSpChangeFDFlags
  797. */
  798.  
  799. /*****************************************************************************/
  800.  
  801. pascal    OSErr    FSpChangeFDFlags(const FSSpec *spec,
  802.                                  Boolean setBits,
  803.                                  unsigned short flagBits);
  804. /*    ¶ Set or clear Finder Flag bits.
  805.     The FSpChangeFDFlags function sets or clears Finder Flag bits in the
  806.     fdFlags field of a file or directory's FInfo record.
  807.     
  808.     spec        input:    An FSSpec record specifying the object.
  809.     setBits        input:    If true, then set the bits specified in flagBits.
  810.                         If false, then clear the bits specified in flagBits.
  811.     flagBits    input:    The flagBits parameter specifies which Finder Flag
  812.                         bits to set or clear. If a bit in flagBits is set,
  813.                         then the same bit in fdFlags is either set or
  814.                         cleared depending on the state of the setBits
  815.                         parameter.
  816.  
  817.     __________
  818.     
  819.     See also:    ChangeFDFlags
  820. */
  821.  
  822. /*****************************************************************************/
  823.  
  824. pascal    OSErr    SetIsInvisible(short vRefNum,
  825.                                long dirID,
  826.                                StringPtr name);
  827. /*    ¶ Set the invisible Finder Flag bit.
  828.     The SetIsInvisible function sets the invisible bit in the fdFlags
  829.     word of the specified file or directory's finder information.
  830.     
  831.     vRefNum    input:    Volume specification.
  832.     dirID    input:    Directory ID.
  833.     name    input:    Pointer to object name, or nil when dirID specifies
  834.                     a directory that's the object.
  835.  
  836.     __________
  837.     
  838.     See also:    FSpSetIsInvisible, ClearIsInvisible, FSpClearIsInvisible
  839. */
  840.  
  841. /*****************************************************************************/
  842.  
  843. pascal    OSErr    FSpSetIsInvisible(const FSSpec *spec);
  844. /*    ¶ Set the invisible Finder Flag bit.
  845.     The FSpSetIsInvisible function sets the invisible bit in the fdFlags
  846.     word of the specified file or directory's finder information.
  847.     
  848.     spec    input:    An FSSpec record specifying the object.
  849.  
  850.     __________
  851.     
  852.     See also:    SetIsInvisible, ClearIsInvisible, FSpClearIsInvisible
  853. */
  854.  
  855. /*****************************************************************************/
  856.  
  857. pascal    OSErr    ClearIsInvisible(short vRefNum,
  858.                                  long dirID,
  859.                                  StringPtr name);
  860. /*    ¶ Clear the invisible Finder Flag bit.
  861.     The ClearIsInvisible function clears the invisible bit in the fdFlags
  862.     word of the specified file or directory's finder information.
  863.     
  864.     vRefNum    input:    Volume specification.
  865.     dirID    input:    Directory ID.
  866.     name    input:    Pointer to object name, or nil when dirID specifies
  867.                     a directory that's the object.
  868.  
  869.     __________
  870.     
  871.     See also:    SetIsInvisible, FSpSetIsInvisible, FSpClearIsInvisible
  872. */
  873.  
  874. /*****************************************************************************/
  875.  
  876. pascal    OSErr    FSpClearIsInvisible(const FSSpec *spec);
  877. /*    ¶ Clear the invisible Finder Flag bit.
  878.     The FSpClearIsInvisible function clears the invisible bit in the fdFlags
  879.     word of the specified file or directory's finder information.
  880.     
  881.     spec    input:    An FSSpec record specifying the object.
  882.  
  883.     __________
  884.     
  885.     See also:    SetIsInvisible, FSpSetIsInvisible, ClearIsInvisible
  886. */
  887.  
  888. /*****************************************************************************/
  889.  
  890. pascal    OSErr    SetNameLocked(short vRefNum,
  891.                               long dirID,
  892.                               StringPtr name);
  893. /*    ¶ Set the nameLocked Finder Flag bit.
  894.     The SetNameLocked function sets the nameLocked bit in the fdFlags word
  895.     of the specified file or directory's finder information.
  896.     
  897.     vRefNum    input:    Volume specification.
  898.     dirID    input:    Directory ID.
  899.     name    input:    Pointer to object name, or nil when dirID specifies
  900.                     a directory that's the object.
  901.  
  902.     __________
  903.     
  904.     See also:    FSpSetNameLocked, ClearNameLocked, FSpClearNameLocked
  905. */
  906.  
  907. /*****************************************************************************/
  908.  
  909. pascal    OSErr    FSpSetNameLocked(const FSSpec *spec);
  910. /*    ¶ Set the nameLocked Finder Flag bit.
  911.     The FSpSetNameLocked function sets the nameLocked bit in the fdFlags word
  912.     of the specified file or directory's finder information.
  913.     
  914.     spec    input:    An FSSpec record specifying the object.
  915.  
  916.     __________
  917.     
  918.     See also:    SetNameLocked, ClearNameLocked, FSpClearNameLocked
  919. */
  920.  
  921. /*****************************************************************************/
  922.  
  923. pascal    OSErr    ClearNameLocked(short vRefNum,
  924.                                 long dirID,
  925.                                 StringPtr name);
  926. /*    ¶ Clear the nameLocked Finder Flag bit.
  927.     The ClearNameLocked function clears the nameLocked bit in the fdFlags
  928.     word of the specified file or directory's finder information.
  929.     
  930.     vRefNum    input:    Volume specification.
  931.     dirID    input:    Directory ID.
  932.     name    input:    Pointer to object name, or nil when dirID specifies
  933.                     a directory that's the object.
  934.  
  935.     __________
  936.     
  937.     See also:    SetNameLocked, FSpSetNameLocked, FSpClearNameLocked
  938. */
  939.  
  940. /*****************************************************************************/
  941.  
  942. pascal    OSErr    FSpClearNameLocked(const FSSpec *spec);
  943. /*    ¶ Clear the nameLocked Finder Flag bit.
  944.     The FSpClearNameLocked function clears the nameLocked bit in the fdFlags
  945.     word of the specified file or directory's finder information.
  946.     
  947.     spec    input:    An FSSpec record specifying the object.
  948.  
  949.     __________
  950.     
  951.     See also:    SetNameLocked, FSpSetNameLocked, ClearNameLocked
  952. */
  953.  
  954. /*****************************************************************************/
  955.  
  956. pascal    OSErr    SetIsStationery(short vRefNum,
  957.                                 long dirID,
  958.                                 ConstStr255Param name);
  959. /*    ¶ Set the isStationery Finder Flag bit.
  960.     The SetIsStationery function sets the isStationery bit in the
  961.     fdFlags word of the specified file or directory's finder information.
  962.     
  963.     vRefNum    input:    Volume specification.
  964.     dirID    input:    Directory ID.
  965.     name    input:    Pointer to object name, or nil when dirID specifies
  966.                     a directory that's the object.
  967.  
  968.     __________
  969.     
  970.     See also:    FSpSetIsStationery, ClearIsStationery, FSpClearIsStationery
  971. */
  972.  
  973. /*****************************************************************************/
  974.  
  975. pascal    OSErr    FSpSetIsStationery(const FSSpec *spec);
  976. /*    ¶ Set the isStationery Finder Flag bit.
  977.     The FSpSetIsStationery function sets the isStationery bit in the
  978.     fdFlags word of the specified file or directory's finder information.
  979.     
  980.     spec    input:    An FSSpec record specifying the object.
  981.  
  982.     __________
  983.     
  984.     See also:    SetIsStationery, ClearIsStationery, FSpClearIsStationery
  985. */
  986.  
  987. /*****************************************************************************/
  988.  
  989. pascal    OSErr    ClearIsStationery(short vRefNum,
  990.                                   long dirID,
  991.                                   ConstStr255Param name);
  992. /*    ¶ Clear the isStationery Finder Flag bit.
  993.     The ClearIsStationery function clears the isStationery bit in the
  994.     fdFlags word of the specified file or directory's finder information.
  995.     
  996.     vRefNum    input:    Volume specification.
  997.     dirID    input:    Directory ID.
  998.     name    input:    Pointer to object name, or nil when dirID specifies
  999.                     a directory that's the object.
  1000.  
  1001.     __________
  1002.     
  1003.     See also:    SetIsStationery, FSpSetIsStationery, FSpClearIsStationery
  1004. */
  1005.  
  1006. /*****************************************************************************/
  1007.  
  1008. pascal    OSErr    FSpClearIsStationery(const FSSpec *spec);
  1009. /*    ¶ Clear the isStationery Finder Flag bit.
  1010.     The FSpClearIsStationery function clears the isStationery bit in the
  1011.     fdFlags word of the specified file or directory's finder information.
  1012.     
  1013.     spec    input:    An FSSpec record specifying the object.
  1014.  
  1015.     __________
  1016.     
  1017.     See also:    SetIsStationery, FSpSetIsStationery, ClearIsStationery
  1018. */
  1019.  
  1020. /*****************************************************************************/
  1021.  
  1022. pascal    OSErr    SetHasCustomIcon(short vRefNum,
  1023.                                  long dirID,
  1024.                                  StringPtr name);
  1025. /*    ¶ Set the hasCustomIcon Finder Flag bit.
  1026.     The SetHasCustomIcon function sets the hasCustomIcon bit in the
  1027.     fdFlags word of the specified file or directory's finder information.
  1028.     
  1029.     vRefNum    input:    Volume specification.
  1030.     dirID    input:    Directory ID.
  1031.     name    input:    Pointer to object name, or nil when dirID specifies
  1032.                     a directory that's the object.
  1033.  
  1034.     __________
  1035.     
  1036.     See also:    FSpSetHasCustomIcon, ClearHasCustomIcon, FSpClearHasCustomIcon
  1037. */
  1038.  
  1039. /*****************************************************************************/
  1040.  
  1041. pascal    OSErr    FSpSetHasCustomIcon(const FSSpec *spec);
  1042. /*    ¶ Set the hasCustomIcon Finder Flag bit.
  1043.     The FSpSetHasCustomIcon function sets the hasCustomIcon bit in the
  1044.     fdFlags word of the specified file or directory's finder information.
  1045.     
  1046.     spec    input:    An FSSpec record specifying the object.
  1047.  
  1048.     __________
  1049.     
  1050.     See also:    SetHasCustomIcon, ClearHasCustomIcon, FSpClearHasCustomIcon
  1051. */
  1052.  
  1053. /*****************************************************************************/
  1054.  
  1055. pascal    OSErr    ClearHasCustomIcon(short vRefNum,
  1056.                                    long dirID,
  1057.                                    StringPtr name);
  1058. /*    ¶ Clear the hasCustomIcon Finder Flag bit.
  1059.     The ClearHasCustomIcon function clears the hasCustomIcon bit in the
  1060.     fdFlags word of the specified file or directory's finder information.
  1061.     
  1062.     vRefNum    input:    Volume specification.
  1063.     dirID    input:    Directory ID.
  1064.     name    input:    Pointer to object name, or nil when dirID specifies
  1065.                     a directory that's the object.
  1066.  
  1067.     __________
  1068.     
  1069.     See also:    SetHasCustomIcon, FSpSetHasCustomIcon, FSpClearHasCustomIcon
  1070. */
  1071.  
  1072. /*****************************************************************************/
  1073.  
  1074. pascal    OSErr    FSpClearHasCustomIcon(const FSSpec *spec);
  1075. /*    ¶ Clear the hasCustomIcon Finder Flag bit.
  1076.     The FSpClearHasCustomIcon function clears the hasCustomIcon bit in the
  1077.     fdFlags word of the specified file or directory's finder information.
  1078.     
  1079.     spec    input:    An FSSpec record specifying the object.
  1080.  
  1081.     __________
  1082.     
  1083.     See also:    SetHasCustomIcon, FSpSetHasCustomIcon, ClearHasCustomIcon
  1084. */
  1085.  
  1086. /*****************************************************************************/
  1087.  
  1088. pascal    OSErr    ClearHasBeenInited(short vRefNum,
  1089.                                    long dirID,
  1090.                                    StringPtr name);
  1091. /*    ¶ Clear the hasBeenInited Finder Flag bit.
  1092.     The ClearHasBeenInited function clears the hasBeenInited bit in the
  1093.     fdFlags word of the specified file or directory's finder information.
  1094.     
  1095.     vRefNum    input:    Volume specification.
  1096.     dirID    input:    Directory ID.
  1097.     name    input:    Pointer to object name, or nil when dirID specifies
  1098.                     a directory that's the object.
  1099.  
  1100.     __________
  1101.     
  1102.     See also:    FSpClearHasBeenInited
  1103. */
  1104.  
  1105. /*****************************************************************************/
  1106.  
  1107. pascal    OSErr    FSpClearHasBeenInited(const FSSpec *spec);
  1108. /*    ¶ Clear the hasBeenInited Finder Flag bit.
  1109.     The FSpClearHasBeenInited function clears the hasBeenInited bit in the
  1110.     fdFlags word of the specified file or directory's finder information.
  1111.     
  1112.     spec    input:    An FSSpec record specifying the object.
  1113.  
  1114.     __________
  1115.     
  1116.     See also:    ClearHasBeenInited
  1117. */
  1118.  
  1119. /*****************************************************************************/
  1120.  
  1121. pascal    OSErr    CopyFileMgrAttributes(short srcVRefNum,
  1122.                                       long srcDirID,
  1123.                                       StringPtr srcName,
  1124.                                       short dstVRefNum,
  1125.                                       long dstDirID,
  1126.                                       StringPtr dstName,
  1127.                                       Boolean copyLockBit);
  1128. /*    ¶ Copy all File Manager attributes from the source to the destination.
  1129.     The CopyFileMgrAttributes function copies all File Manager attributes
  1130.     from the source file or directory to the destination file or directory.
  1131.     If copyLockBit is true, then set the locked state of the destination
  1132.     to match the source.
  1133.  
  1134.     srcVRefNum    input:    Source volume specification.
  1135.     srcDirID    input:    Source directory ID.
  1136.     srcName        input:    Pointer to source object name, or nil when
  1137.                         srcDirID specifies a directory that's the object.
  1138.     dstVRefNum    input:    Destination volume specification.
  1139.     dstDirID    input:    Destination directory ID.
  1140.     dstName        input:    Pointer to destination object name, or nil when
  1141.                         dstDirID specifies a directory that's the object.
  1142.     copyLockBit    input:    If true, set the locked state of the destination
  1143.                         to match the source.
  1144.  
  1145.     __________
  1146.     
  1147.     See also:    FSpCopyFileMgrAttributes
  1148. */
  1149.  
  1150. /*****************************************************************************/
  1151.  
  1152. pascal    OSErr    FSpCopyFileMgrAttributes(const FSSpec *srcSpec,
  1153.                                          const FSSpec *dstSpec,
  1154.                                          Boolean copyLockBit);
  1155. /*    ¶ Copy all File Manager attributes from the source to the destination.
  1156.     The FSpCopyFileMgrAttributes function copies all File Manager attributes
  1157.     from the source file or directory to the destination file or directory.
  1158.     If copyLockBit is true, then set the locked state of the destination
  1159.     to match the source.
  1160.  
  1161.     srcSpec        input:    An FSSpec record specifying the source object.
  1162.     dstSpec        input:    An FSSpec record specifying the destination object.
  1163.     copyLockBit    input:    If true, set the locked state of the destination
  1164.                         to match the source.
  1165.  
  1166.     __________
  1167.     
  1168.     See also:    CopyFileMgrAttributes
  1169. */
  1170.  
  1171. /*****************************************************************************/
  1172.  
  1173. pascal    OSErr    HOpenAware(short vRefNum,
  1174.                            long dirID,
  1175.                            ConstStr255Param fileName,
  1176.                            short denyModes,
  1177.                            short *refNum);
  1178. /*    ¶ Open the data fork of a file using deny mode permissions.
  1179.     The HOpenAware function opens the data fork of a file using deny mode
  1180.     permissions instead the normal File Manager permissions.  If OpenDeny
  1181.     is not available, then HOpenAware translates the deny modes to the
  1182.     closest File Manager permissions and tries to open the file with
  1183.     OpenDF first, and then Open if OpenDF isn't available. By using
  1184.     HOpenAware with deny mode permissions, a program can be "AppleShare
  1185.     aware" and fall back on the standard File Manager open calls
  1186.     automatically.
  1187.  
  1188.     vRefNum        input:    Volume specification.
  1189.     dirID        input:    Directory ID.
  1190.     fileName    input:    The name of the file.
  1191.     denyModes    input:    The deny modes access under which to open the file.
  1192.     refNum        output:    The file reference number of the opened file.
  1193.  
  1194.     __________
  1195.     
  1196.     See also:    FSpOpenAware, HOpenRFAware, FSpOpenRFAware
  1197. */
  1198.  
  1199. /*****************************************************************************/
  1200.  
  1201. pascal    OSErr    FSpOpenAware(const FSSpec *spec,
  1202.                              short denyModes,
  1203.                              short *refNum);
  1204. /*    ¶ Open the data fork of a file using deny mode permissions.
  1205.     The FSpOpenAware function opens the data fork of a file using deny mode
  1206.     permissions instead the normal File Manager permissions.  If OpenDeny
  1207.     is not available, then FSpOpenAware translates the deny modes to the
  1208.     closest File Manager permissions and tries to open the file with
  1209.     OpenDF first, and then Open if OpenDF isn't available. By using
  1210.     FSpOpenAware with deny mode permissions, a program can be "AppleShare
  1211.     aware" and fall back on the standard File Manager open calls
  1212.     automatically.
  1213.  
  1214.     spec        input:    An FSSpec record specifying the file.
  1215.     denyModes    input:    The deny modes access under which to open the file.
  1216.     refNum        output:    The file reference number of the opened file.
  1217.  
  1218.     __________
  1219.     
  1220.     See also:    HOpenAware, HOpenRFAware, FSpOpenRFAware
  1221. */
  1222.  
  1223. /*****************************************************************************/
  1224.  
  1225. pascal    OSErr    HOpenRFAware(short vRefNum,
  1226.                              long dirID,
  1227.                              ConstStr255Param fileName,
  1228.                              short denyModes,
  1229.                              short *refNum);
  1230. /*    ¶ Open the resource fork of a file using deny mode permissions.
  1231.     The HOpenRFAware function opens the resource fork of a file using deny
  1232.     mode permissions instead the normal File Manager permissions.  If
  1233.     OpenRFDeny is not available, then HOpenRFAware translates the deny
  1234.     modes to the closest File Manager permissions and tries to open the
  1235.     file with OpenRF. By using HOpenRFAware with deny mode permissions,
  1236.     a program can be "AppleShare aware" and fall back on the standard
  1237.     File Manager open calls automatically.
  1238.  
  1239.     vRefNum        input:    Volume specification.
  1240.     dirID        input:    Directory ID.
  1241.     fileName    input:    The name of the file.
  1242.     denyModes    input:    The deny modes access under which to open the file.
  1243.     refNum        output:    The file reference number of the opened file.
  1244.  
  1245.     __________
  1246.     
  1247.     See also:    HOpenAware, FSpOpenAware, FSpOpenRFAware
  1248. */
  1249.  
  1250. /*****************************************************************************/
  1251.  
  1252. pascal    OSErr    FSpOpenRFAware(const FSSpec *spec,
  1253.                                short denyModes,
  1254.                                short *refNum);
  1255. /*    ¶ Open the resource fork of a file using deny mode permissions.
  1256.     The FSpOpenRFAware function opens the resource fork of a file using deny
  1257.     mode permissions instead the normal File Manager permissions.  If
  1258.     OpenRFDeny is not available, then FSpOpenRFAware translates the deny
  1259.     modes to the closest File Manager permissions and tries to open the
  1260.     file with OpenRF. By using FSpOpenRFAware with deny mode permissions,
  1261.     a program can be "AppleShare aware" and fall back on the standard
  1262.     File Manager open calls automatically.
  1263.  
  1264.     spec        input:    An FSSpec record specifying the file.
  1265.     denyModes    input:    The deny modes access under which to open the file.
  1266.     refNum        output:    The file reference number of the opened file.
  1267.  
  1268.     __________
  1269.     
  1270.     See also:    HOpenAware, FSpOpenAware, HOpenRFAware
  1271. */
  1272.  
  1273. /*****************************************************************************/
  1274.  
  1275. pascal    OSErr    FSReadNoCache(short refNum,
  1276.                               long *count,
  1277.                               void *buffPtr);
  1278. /*    ¶ Read any number of bytes from an open file requesting no caching.
  1279.     The FSReadNoCache function reads any number of bytes from an open file
  1280.     while asking the file system to bypass its cache mechanism.
  1281.     
  1282.     refNum    input:    The file reference number of an open file.
  1283.     count    input:    The number of bytes to read.
  1284.             output:    The number of bytes actually read.
  1285.     buffPtr    input:    A pointer to the data buffer into which the bytes are
  1286.                     to be read.
  1287.  
  1288.     __________
  1289.     
  1290.     See also:    FSWriteNoCache
  1291. */
  1292.  
  1293. /*****************************************************************************/
  1294.  
  1295. pascal    OSErr    FSWriteNoCache(short refNum,
  1296.                                long *count,
  1297.                                const void *buffPtr);
  1298. /*    ¶ Write any number of bytes to an open file requesting no caching.
  1299.     The FSReadNoCache function writes any number of bytes to an open file
  1300.     while asking the file system to bypass its cache mechanism.
  1301.     
  1302.     refNum    input:    The file reference number of an open file.
  1303.     count    input:    The number of bytes to write to the file.
  1304.             output:    The number of bytes actually written.
  1305.     buffPtr    input:    A pointer to the data buffer from which the bytes are
  1306.                     to be written.
  1307.  
  1308.     __________
  1309.     
  1310.     See also:    FSReadNoCache
  1311. */
  1312.  
  1313. /*****************************************************************************/
  1314.  
  1315. pascal    OSErr    FSWriteVerify(short refNum,
  1316.                               long *count,
  1317.                               const void *buffPtr);
  1318. /*    ¶ Write any number of bytes to an open file and then verify the data was written.
  1319.     The FSWriteVerify function writes any number of bytes to an open file
  1320.     and then verifies that the data was actually written to the device.
  1321.     
  1322.     refNum    input:    The file reference number of an open file.
  1323.     count    input:    The number of bytes to write to the file.
  1324.             output:    The number of bytes actually written and verified.
  1325.     buffPtr    input:    A pointer to the data buffer from which the bytes are
  1326.                     to be written.
  1327. */
  1328.  
  1329. /*****************************************************************************/
  1330.  
  1331. pascal    OSErr    CopyFork(short srcRefNum,
  1332.                          short dstRefNum,
  1333.                          void *copyBufferPtr,
  1334.                          long copyBufferSize);
  1335. /*    ¶ Copy all data from the source fork to the destination fork of open file forks.
  1336.     The CopyFork function copies all data from the source fork to the
  1337.     destination fork of open file forks and makes sure the destination EOF
  1338.     is equal to the source EOF.
  1339.     
  1340.     srcRefNum        input:    The source file reference number.
  1341.     dstRefNum        input:    The destination file reference number.
  1342.     copyBufferPtr    input:    Pointer to buffer to use during copy. The
  1343.                             buffer should be at least 512-bytes minimum.
  1344.                             The larger the buffer, the faster the copy.
  1345.     copyBufferSize    input:    The size of the copy buffer.
  1346. */
  1347.  
  1348. /*****************************************************************************/
  1349.  
  1350. pascal    OSErr    GetFileLocation(short refNum,
  1351.                                 short *vRefNum,
  1352.                                 long *dirID,
  1353.                                 StringPtr fileName);
  1354. /*    ¶ Get the location of an open file.
  1355.     The GetFileLocation function gets the location (volume reference number,
  1356.     directory ID, and fileName) of an open file.
  1357.  
  1358.     refNum        input:    The file reference number of an open file.
  1359.     vRefNum        output:    The volume reference number.
  1360.     dirID        output:    The parent directory ID.
  1361.     fileName    input:    Points to a buffer (minimum Str63) where the
  1362.                         filename is to be returned or must be nil.
  1363.                 output:    The filename.
  1364.  
  1365.     __________
  1366.     
  1367.     See also:    FSpGetFileLocation
  1368. */
  1369.  
  1370. /*****************************************************************************/
  1371.  
  1372. pascal    OSErr    FSpGetFileLocation(short refNum,
  1373.                                    FSSpec *spec);
  1374. /*    ¶ Get the location of an open file in an FSSpec record.
  1375.     The FSpGetFileLocation function gets the location of an open file in
  1376.     an FSSpec record.
  1377.  
  1378.     refNum        input:    The file reference number of an open file.
  1379.     spec        output:    FSSpec record containing the file name and location.
  1380.  
  1381.     __________
  1382.     
  1383.     See also:    GetFileLocation
  1384. */
  1385.  
  1386. /*****************************************************************************/
  1387.  
  1388. pascal    OSErr    CopyDirectoryAccess(short srcVRefNum,
  1389.                                     long srcDirID,
  1390.                                     StringPtr srcName,
  1391.                                     short dstVRefNum,
  1392.                                     long dstDirID,
  1393.                                     StringPtr dstName);
  1394. /*    ¶ Copy the AFP directory access privileges.
  1395.     The CopyDirectoryAccess function copies the AFP directory access
  1396.     privileges from one directory to another. Both directories must be on
  1397.     the same file server, but not necessarily on the same server volume.
  1398.     
  1399.     srcVRefNum    input:    Source volume specification.
  1400.     srcDirID    input:    Source directory ID.
  1401.     srcName        input:    Pointer to source directory name, or nil when
  1402.                         srcDirID specifies the directory.
  1403.     dstVRefNum    input:    Destination volume specification.
  1404.     dstDirID    input:    Destination directory ID.
  1405.     dstName        input:    Pointer to destination directory name, or nil when
  1406.                         dstDirID specifies the directory.
  1407.  
  1408.     __________
  1409.     
  1410.     See also:    FSpCopyDirectoryAccess
  1411. */
  1412.  
  1413. /*****************************************************************************/
  1414.  
  1415. pascal    OSErr    FSpCopyDirectoryAccess(const FSSpec *srcSpec,
  1416.                                        const FSSpec *dstSpec);
  1417. /*    ¶ Copy the AFP directory access privileges.
  1418.     The FSpCopyDirectoryAccess function copies the AFP directory access
  1419.     privileges from one directory to another. Both directories must be on
  1420.     the same file server, but not necessarily on the same server volume.
  1421.  
  1422.     srcSpec        input:    An FSSpec record specifying the source directory.
  1423.     dstSpec        input:    An FSSpec record specifying the destination directory.
  1424.  
  1425.     __________
  1426.     
  1427.     See also:    CopyDirectoryAccess
  1428. */
  1429.  
  1430. /*****************************************************************************/
  1431.  
  1432. pascal    OSErr    HMoveRenameCompat(short vRefNum,
  1433.                                   long srcDirID,
  1434.                                   ConstStr255Param srcName,
  1435.                                   long dstDirID,
  1436.                                   StringPtr dstpathName,
  1437.                                   StringPtr copyName);
  1438. /*    ¶ Move a file or directory and optionally rename it.
  1439.     The HMoveRenameCompat function moves a file or directory and optionally
  1440.     renames it.  The source and destination locations must be on the same
  1441.     volume. This routine works even if the volume doesn't support MoveRename.
  1442.     
  1443.     vRefNum        input:    Volume specification.
  1444.     srcDirID    input:    Source directory ID.
  1445.     srcName        input:    The source object name.
  1446.     dstDirID    input:    Destination directory ID.
  1447.     dstName        input:    Pointer to destination directory name, or
  1448.                         nil when dstDirID specifies a directory.
  1449.     copyName    input:    Points to the new name if the object is to be
  1450.                         renamed or nil if the object isn't to be renamed.
  1451.  
  1452.     __________
  1453.     
  1454.     See also:    FSpMoveRenameCompat
  1455. */
  1456.  
  1457. /*****************************************************************************/
  1458.  
  1459. pascal    OSErr    FSpMoveRenameCompat(const FSSpec *srcSpec,
  1460.                                     const FSSpec *dstSpec,
  1461.                                     StringPtr copyName);
  1462. /*    ¶ Move a file or directory and optionally rename it.
  1463.     The FSpMoveRenameCompat function moves a file or directory and optionally
  1464.     renames it.  The source and destination locations must be on the same
  1465.     volume. This routine works even if the volume doesn't support MoveRename.
  1466.     
  1467.     srcSpec        input:    An FSSpec record specifying the source object.
  1468.     dstSpec        input:    An FSSpec record specifying the destination
  1469.                         directory.
  1470.     copyName    input:    Points to the new name if the object is to be
  1471.                         renamed or nil if the object isn't to be renamed.
  1472.  
  1473.     __________
  1474.     
  1475.     See also:    HMoveRenameCompat
  1476. */
  1477.  
  1478. /*****************************************************************************/
  1479.  
  1480. pascal    void    BuildAFPVolMountInfo(short theFlags,
  1481.                                      char theNBPInterval,
  1482.                                      char theNBPCount,
  1483.                                      short theUAMType,
  1484.                                      Str31 theZoneName,
  1485.                                      Str31 theServerName,
  1486.                                      Str27 theVolName,
  1487.                                      Str31 theUserName,
  1488.                                      Str8 theUserPassWord,
  1489.                                      Str8 theVolPassWord,
  1490.                                      MyAFPVolMountInfoPtr theAFPInfo);
  1491. /*    ¶ Initialize the fields of an AFPVolMountInfo record.
  1492.     The BuildAFPVolMountInfo function initializes the fields of an
  1493.     AFPVolMountInfo record for use before using that record to call
  1494.     the VolumeMount function.
  1495.     
  1496.     theFlags        input:    The AFP mounting flags. 0 = normal mount;
  1497.                             set bit 0 to inhibit greeting messages.
  1498.     theNBPInterval    input:    The interval used for VolumeMount's
  1499.                             NBP Lookup call. 7 is a good choice.
  1500.     theNBPCount        input:    The retry count used for VolumeMount's
  1501.                             NBP Lookup call. 5 is a good choice.
  1502.     theUAMType        input:    The user authentication method to use.
  1503.     theZoneName        input:    The AppleTalk zone name of the server.
  1504.     theServerName    input:    The AFP server name.
  1505.     theVolName        input:    The AFP volume name.
  1506.     theUserName        input:    The user name (zero length Pascal string for
  1507.                             guest).
  1508.     theUserPassWord    input:    The user password (zero length Pascal string
  1509.                             if no user password)
  1510.     theVolPassWord    input:    The volume password (zero length Pascal string
  1511.                             if no volume password)
  1512.     theAFPInfo        input:    Pointer to AFPVolMountInfo record to
  1513.                             initialize.
  1514.  
  1515.     __________
  1516.     
  1517.     Also see:    GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
  1518.                 RetrieveAFPVolMountInfo
  1519. */
  1520.  
  1521. /*****************************************************************************/
  1522.  
  1523. pascal    OSErr    RetrieveAFPVolMountInfo(AFPVolMountInfoPtr theAFPInfo,
  1524.                                         short *theFlags,
  1525.                                         short *theUAMType,
  1526.                                         StringPtr theZoneName,
  1527.                                         StringPtr theServerName,
  1528.                                         StringPtr theVolName,
  1529.                                         StringPtr theUserName);
  1530. /*    ¶ Retrieve the AFP mounting information from an AFPVolMountInfo record.
  1531.     The RetrieveAFPVolMountInfo function retrieves the AFP mounting
  1532.     information returned in an AFPVolMountInfo record by the
  1533.     GetVolMountInfo function.
  1534.     
  1535.     theAFPInfo        input:    Pointer to AFPVolMountInfo record that contains
  1536.                             the AFP mounting information.
  1537.     theFlags        output:    The AFP mounting flags. 0 = normal mount;
  1538.                             if bit 0 is set, greeting meesages were inhibited.
  1539.     theUAMType        output:    The user authentication method used.
  1540.     theZoneName        output:    The AppleTalk zone name of the server.
  1541.     theServerName    output:    The AFP server name.
  1542.     theVolName        output:    The AFP volume name.
  1543.     theUserName        output:    The user name (zero length Pascal string for
  1544.                             guest).
  1545.  
  1546.     __________
  1547.     
  1548.     Also see:    GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
  1549.                 BuildAFPVolMountInfo
  1550. */
  1551.  
  1552. /*****************************************************************************/
  1553.  
  1554. pascal    OSErr    GetUGEntries(short objType,
  1555.                              UGEntryPtr entries,
  1556.                              long reqEntryCount,
  1557.                              long *actEntryCount,
  1558.                              long *objID);
  1559. /*    ¶ Retrieve a list of user or group entries from the local file server.
  1560.     The GetUGEntries functions retrieves a list of user or group entries
  1561.     fromthe local file server.
  1562.  
  1563.     objType            input:    The object type: -1 = group; 0 = user
  1564.     UGEntries        input:    Pointer to array of UGEntry records where the list
  1565.                             is returned.
  1566.     reqEntryCount    input:    The number of elements in the UGEntries array.
  1567.     actEntryCount    output:    The number of entries returned.
  1568.     objID            input:    The current index position. Set to 0 to start with
  1569.                             the first entry.
  1570.                     output:    The index position to get the next entry. Pass this
  1571.                             value the next time you call GetUGEntries to start
  1572.                             where you left off.
  1573.  
  1574.     __________
  1575.     
  1576.     Also see:    GetUGEntry
  1577. */
  1578.  
  1579. /*****************************************************************************/
  1580.  
  1581. #endif    /* __MOREFILESEXTRAS__ */